# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "e无忧泰康全能保（少儿版）"

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            if item["plan"] == "普惠款":
                majorDisease = "10w"
                slightDisease = "2w"
                generalMedic = "50w"
                seriousCancer = "50w"
                accidentDeath = "10w"
                accidentMedic="1w"
                airplaneDeath = "100w"
            elif item["plan"] == "优享款":
                majorDisease = "30w"
                slightDisease = "6w"
                generalMedic = "100w"
                seriousCancer = "100w"
                accidentDeath = "20w"
                accidentMedic = "2w"
                airplaneDeath = "500w"
            else:
                majorDisease = "45w"
                slightDisease = "10w"
                generalMedic = "100w"
                seriousCancer = "100w"
                accidentDeath = "50w"
                accidentMedic = "3w"
                airplaneDeath = "500w"
            data["name"] = self.name
            data["company"] = "泰康保险"
            data["gender"] = "0" if item["gender"] == "F" else "1"
            data["socialSec"] = item["socialSec"]
            data["expire"] = "1年"
            data["payType"] = "年交"
            data["majorDisease"] = majorDisease
            data["slightDisease"] = slightDisease
            data["generalMedic"] = generalMedic
            data["seriousCancer"] = seriousCancer
            data["accidentDeath"] = accidentDeath
            data["accidentMedic"] = accidentMedic
            data["airplaneDeath"] = airplaneDeath
            data["price"] = item["price"]
            Helper.mergeTable(self.name,self.mysql,data )



if __name__ == '__main__':
    a = Arrangement()
    a.pullData()
